package cn.jetpiece.cloud.system.dp.app.enums;

import lombok.Getter;

/**
 * @ProjectName: jetpiece-system-bpm
 * @ClassName: cn.jetpiece.cloud.system.dp.app.enums.ApiMethodEnum
 * @Author: zdingxin
 * @Description:
 * @Date: 2023-05-25
 * @Version: 1.0
 */
@Getter
public enum ApiMethodEnum {
    GET("GET", 1),
    POST("POST", 2),
    PUT("PUT", 3),
    DELETE("DELETE", 4);

    private String code;
    private Integer value;

    ApiMethodEnum(String code, Integer value) {
        this.code = code;
        this.value = value;
    }

    public static String getCode(Integer value) {
        for (ApiMethodEnum e : ApiMethodEnum.values()) {
            if (e.getValue().equals(value)) {
                return e.getCode();
            }
        }
        return null;
    }
}
